const Navbar = () => import('@/components/navbar')
const Tabbar = () => import('@/components/tabbar')

const routes = [
  {
    path: '/',
    redirect: '/start',
  },
  {
    path: '/start',
    name: 'Start',
    component: () => import('@/views/start'),
  },
  {
    path: '/home',
    name: 'Home',
    components: {
      default: () => import('@/views/home'),
      footer: Tabbar,
    },
    meta: {
      intabbar: 'true',
      icon: 'home-o',
      title: '首页',
      needPermission: true,
    },
  },
  {
    path: '/category',
    name: 'Category',
    components: {
      default: () => import('@/views/category'),
      footer: Tabbar,
    },
    meta: {
      intabbar: 'true',
      icon: 'apps-o',
      title: '分类',
      needPermission: true,
    },
  },
  {
    path: '/my-study',
    name: 'MyStudy',
    components: {
      default: () => import('@/views/my-study'),
      footer: Tabbar,
    },
    meta: {
      intabbar: 'true',
      icon: 'video-o',
      title: '我的学习',
      needPermission: true,
    },
  },
  {
    path: '/mine',
    name: 'Mine',
    components: {
      default: () => import('@/views/mine'),
      footer: Tabbar,
    },
    meta: {
      intabbar: 'true',
      icon: 'manager-o',
      title: '我的',
      needPermission: true,
    },
  },
  {
    path: '/adjust-classification',
    name: 'AdjustClassification',
    components: {
      header: Navbar,
      default: () => import('@/views/adjust-classification'),
    },
    meta: {
      title: '感兴趣的分类',
      needPermission: true,
    },
  },
  {
    path: '/balance',
    name: 'Balance',
    components: {
      header: Navbar,
      default: () => import('@/views/balance'),
    },
    meta: {
      title: '我的余额',
      needPermission: true,
    },
  },
  {
    path: '/category-list',
    name: 'CategoryList',
    components: {
      header: Navbar,
      default: () => import('@/views/category-list'),
    },
    meta: {
      title: '分类列表',
      needPermission: true,
    },
  },
  {
    path: '/confirm',
    name: 'Confirm',
    components: {
      header: Navbar,
      default: () => import('@/views/confirm'),
    },
    meta: {
      title: '确认订单',
      needPermission: true,
    },
  },
  {
    path: '/courtesy-card',
    name: 'CourtesyCard',
    components: {
      header: Navbar,
      default: () => import('@/views/courtesy-card'),
    },
    meta: {
      title: '我的优惠券',
      needPermission: true,
    },
  },
  {
    path: '/detail',
    name: 'Detail',
    components: {
      header: Navbar,
      default: () => import('@/views/detail'),
    },
    meta: {
      title: '课程详情',
      needPermission: true,
    },
  },
  {
    path: '/excellent-courses',
    name: 'ExcellentCourses',
    components: {
      header: Navbar,
      default: () => import('@/views/excellent-courses'),
    },
    meta: {
      title: '精品课程',
      needPermission: true,
    },
  },
  {
    path: '/extension',
    name: 'Extension',
    components: {
      header: Navbar,
      default: () => import('@/views/extension'),
    },
    meta: {
      title: '我的推广',
      needPermission: true,
    },
  },
  {
    path: '/follow',
    name: 'Follow',
    components: {
      header: Navbar,
      default: () => import('@/views/follow'),
    },
    meta: {
      title: '我的关注',
      needPermission: true,
    },
  },
  {
    path: '/free-zone',
    name: 'FreeZone',
    components: {
      header: Navbar,
      default: () => import('@/views/free-zone'),
    },
    meta: {
      title: '免费专区',
      needPermission: true,
    },
  },
  {
    path: '/good-courses',
    name: 'GoodCourses',
    components: {
      header: Navbar,
      default: () => import('@/views/good-courses'),
    },
    meta: {
      title: '热门好课',
      needPermission: true,
    },
  },
  {
    path: '/help',
    name: 'Help',
    components: {
      header: Navbar,
      default: () => import('@/views/help'),
    },
    meta: {
      title: '在线咨询',
      needPermission: true,
    },
  },
  {
    path: '/login',
    name: 'Login',
    components: {
      header: Navbar,
      default: () => import('@/views/login'),
    },
    meta: {
      title: '登录页面',
      needPermission: true,
    },
  },
  {
    path: '/order',
    name: 'Order',
    components: {
      header: Navbar,
      default: () => import('@/views/order'),
    },
    meta: {
      title: '我的订单',
      needPermission: true,
    },
  },
  {
    path: '/payment-failed',
    name: 'PaymentFailed',
    components: {
      header: Navbar,
      default: () => import('@/views/payment-failed'),
    },
    meta: {
      title: '支付失败',
      needPermission: true,
    },
  },
  {
    path: '/payment-succeeded',
    name: 'PaymentSucceeded',
    components: {
      header: Navbar,
      default: () => import('@/views/payment-succeeded'),
    },
    meta: {
      title: '支付成功',
      needPermission: true,
    },
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('@/views/search'),
    meta: {
      title: '搜索',
      needPermission: true,
    },
  },
  {
    path: '/set-up',
    name: 'SetUp',
    components: {
      header: Navbar,
      default: () => import('@/views/set-up'),
    },
    meta: {
      title: '搜索',
      needPermission: true,
    },
  },
  {
    path: '/teacher',
    name: 'Teacher',
    components: {
      header: Navbar,
      default: () => import('@/views/teacher'),
    },
    meta: {
      title: '老师主页',
      needPermission: true,
    },
  },
  {
    path: '/time-offer',
    name: 'TimeOffer',
    components: {
      header: Navbar,
      default: () => import('@/views/time-offer'),
    },
    meta: {
      title: '限时优惠',
      needPermission: true,
    },
  },
  {
    path: '*',
    component: () => import('@/views/not-found'),
  },
]
export default routes
